int add_func(int a, int b)
{
    // 1.计算a+b的和，不使用+运算符
    int tmp = 0;
    while(b != 0)
    {
        tmp = a ^ b;  // 保留不需要进位的值
        b = (a & b) << 1;  // 同过按位与提取出需要进位的值，并左移以为代表进位。
        a = tmp;
    }
    return tmp;
}

int tail_zero(int n)
{
    // 2.尾部零问题
    int i = 5;
    int num = 0;
    while(i<=n)
    {
        num += n / i;
        i *= 5;
    }
    return num;
}

int count_num(int k, int n)
{
    //3.统计数字
    int count = 0 , x;
    if (k == 0 && n == 0) 
        count = 1;
    for (int i = 1;x = n / i;i *= 10) {
        int high = x / 10;
        if (k == 0) {
            if (high) 
                high--;
            else {
                count++;
                break;
            }
        }
        count += high * i;
        int current = x % 10;
        if (current > k) 
            count += i;
        else if (current == k) 
            count += n - x * i + 1;
    }
    return count;
}